# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-cli-helpers
pkgname=('python2-cli-helpers' 'python-cli-helpers')
_pkgname=cli_helpers
pkgver=2.6.0
pkgrel=1
pkgdesc='Helpers for building command-line apps.'
arch=('any')
url='https://pypi.org/project/cli-helpers/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/cli_helpers-$pkgver.tar.gz")
sha512sums=('0959b59c9ed5437efdd4eb09ce41f2069ade32a83564a997d60a4b8803d3156903a046b146bbcca2b592a54b04a7745482e75c63584376b58f943e04d3104d46')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-cli-helpers() {
  depends=('python2' 'python2-tabulate' 'python2-terminaltables'
           'python2-backports-csv')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-cli-helpers() {
  depends=('python' 'python-tabulate' 'python-terminaltables'
           'python-backports.csv')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

